home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 1134 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.0 KB

  1. Path: colossus.holonet.net!mitch
  2. From: mitch@news.mdli.com (Mitch Miller)
  3. Newsgroups: comp.lang.c
  4. Subject: Problem with sscanf on DEC Alpha
  5. Date: 11 Jan 1996 16:48:12 GMT
  6. Organization: HoloNet National Internet Access System: 510-704-1058/modem
  7. Message-ID: <4d3f0c$mfq@colossus.holonet.net>
  8. NNTP-Posting-Host: jubal.mdli.com
  9. Summary: What's the correct input format for a double variable?
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. I'm having a problem with a line in my program:
  13.  
  14.   sscanf( sInputLine, "%3d%3d%10.4f%10.4f", &iAtom1, 
  15.     &iAtom2, &(F3D->r3DV1), &(F3D->r3DV2) );
  16.  
  17. F3D is a pointer to struct and the struct has double members
  18. r3DV1 and r3DV2.  
  19.  
  20. My input line consists of
  21.   4  5    9.4000   10.5000
  22.  
  23. When I've compiled/run this on a VAX, both F3D->r3DV1 and F3D->r3DV2 
  24. get assigned correctly 9.4 and 10.5.  However, on the Alpha, both
  25. end up as 0.0.  I've tried several variations on the %10.4f, to no
  26. avail.  BTW, iAtom1 and iAtom2 are assigned correctly on both systems.
  27.  
  28. Any ideas on how to resolve the problem?
  29.